package view;

import java.awt.BorderLayout;
import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JSplitPane;

import view.subscriberpanels.FilteringPane;
import view.subscriberpanels.NavigationPane;
import view.subscriberpanels.SelectionPane;
import view.subscriberpanels.VisPane;

public class UIMain {

	private static int HEIGHT = 850;
	private static int WIDTH = 1300;
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// Setup the main frame
		JFrame frame = new JFrame("InfoVis Project");
		frame.setMinimumSize(new Dimension(WIDTH, HEIGHT));
		frame.setLayout(new BorderLayout());
		
		
        frame.add(new VisPane(), BorderLayout.CENTER);
        
        
		// Filter panel
		FilteringPane filterPane = new FilteringPane();
		
		// Bottom-right panel
		NavigationPane navPane = new NavigationPane();
		
		JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, 
				filterPane, navPane);
		splitPane.setOneTouchExpandable(true);
		splitPane.setDividerLocation((int)(frame.getHeight()/1.5));
		splitPane.setPreferredSize(new Dimension(200, HEIGHT));
		frame.add(splitPane, BorderLayout.EAST);
		
		SelectionPane selectionPane = new SelectionPane();
		selectionPane.setPreferredSize(new Dimension(200, HEIGHT));
		frame.add(selectionPane, BorderLayout.WEST);
		
		ViewManager.getCurrentVis();
		
		// Display
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.pack();
        frame.setVisible(true);
	}
}
